<template>
  <a-config-provider :locale="locale">
    <div id="app">
      <router-view/>
    </div>
  </a-config-provider>
</template>

<script>
  // import $ from 'jquery'
  import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
  // import { domTitle, setDocumentTitle } from '@/utils/domUtil'
  // import { i18nRender } from '@/locales'
  export default {
    data () {
      return {
        locale: zhCN
      }
    },
    computed: {
      // locale () {
      //   // 只是为了切换语言时，更新标题
      //   const { title } = this.$route.meta
      //   title && (setDocumentTitle(`${i18nRender(title)} - ${domTitle}`))
      //   return this.$i18n.getLocaleMessage(this.$store.getters.lang).antLocale
      // }
    },
    mounted () {
      // console.log($('#app')[0].children[0])
      // const menu = $('#app')[0].children[0].children[0].children[0]
      // console.log(menu)// 左侧上下
      // console.log(menu.children[1])// 左侧下
    },
    created () {
      // 在页面加载时读取sessionStorage里的状态信息
      if (sessionStorage.getItem('store')) {
        this.$store.replaceState(Object.assign({}, this.$store.state, JSON.parse(sessionStorage.getItem('store'))))
      }

      // 在页面刷新时将vuex里的信息保存到sessionStorage里
      window.addEventListener('beforeunload', () => {
        sessionStorage.setItem('store', JSON.stringify(this.$store.state))
      })
    }
  }
</script>
<style lang="less">
  @import './assets/css/basic.css';
  @import './assets/css/hover.css';

  @font-face {
    font-family: lticon;
    /* project id 2168678 */
    font-weight: normal;
    font-style: normal;
    src: url('//at.alicdn.com/t/font_2168678_l84yh0k7uk.ttf') format('truetype');
  }

  .ant-layout-sider.ant-layout-sider-dark.ant-pro-sider-menu-sider.ant-pro-sider-menu {
    overflow: hidden;
  }

  .ant-layout-sider.ant-layout-sider-dark.ant-layout-sider-below.nt-pro-sider-menu-sider {
    overflow-x: hidden;
  }

  /*左侧导航重置样式*/
  .ant-layout-sider-children {
    background-color: #363636;
    overflow-y: auto !important;
    height: 100vh !important;
    width: 266px !important;

    .ant-menu {
      background-color: #363636 !important;
      width: 204px !important;
      margin: 0 auto !important;
      border-radius: 12px !important;
      color: #babdc1 !important;
      overflow: hidden;

      .ant-menu-submenu-title {
        border-radius: 12px !important;
        // overflow: hidden;
      }

      .ant-menu-item {
        // width: 190px !important;
        margin: 0 auto 3px auto !important;
        text-align: center;
        padding-left: 0 !important;
        padding-right: 0 !important;
        border-radius: 12px !important;

        a {
          color: #babdc1 !important;
          display: flex;
          align-items: center;
          justify-content: flex-start;

          .anticon {
            margin-left: 25px;
          }
        }
      }

      .ant-menu-submenu {
        margin-bottom: 3px !important;
      }

      .ant-menu-submenu-open {
        padding-bottom: 14px !important;
      }

      .ant-menu-item::after {
        content: '\e7db';
        font-family: 'lticon' !important;
        font-size: 10px;
        right: 17px;
        // margin-right: 16px;
        opacity: 1 !important;
        font-style: normal;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        transform: scale(0.6);
        color: #c1bebe;
        display: block;
        border-right: 0px !important;
      }

      .ant-menu-item-selected {
        // transition: auto !important;
        background-color: #313030 !important;
        border-radius: 12px !important;
      }

      .ant-menu-item-selected.ant-menu-item::after {
        content: '\e7da';
      }

      .ant-menu-submenu-title {
        margin-top: 0 !important;
      }
    }

    .ant-menu-inline,
    .ant-menu-vertical,
    .ant-menu-vertical-left {
      border-right: 0px;
    }

    .ant-menu-submenu-open {
      background-color: #313030 !important;
      border-radius: 12px !important;
      overflow: hidden;

      .ant-menu {
        background-color: #313030 !important;
        box-shadow: 0 0 black !important;
      }
    }

    .ant-menu-submenu-inline {
      .ant-menu-item {
        a {
          // color: white !important;
          display: block;

          .anticon {
            margin-left: 0px;
          }
        }
      }
    }

    .ant-menu-inline-collapsed {
      width: auto !important;

      .ant-menu-item {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        padding: -1 !important;

        a {
          margin: 0 auto;

          .anticon {
            margin: 0 auto;
          }
        }
      }
    }

    .ant-menu-item,
    .ant-menu-submenu-title {
      height: 44px !important;
      line-height: 44px !important;
    }

    .ant-menu-root {
      .router-link-active {
        width: 100% !important;
        background-color: #1e6deb !important;
        border-radius: 12px !important;
        margin: 0 auto;
      }
    }

    .ant-menu-sub {
      .router-link-active {
        width: 176px !important;
        background-color: #1e6deb !important;
        border-radius: 12px !important;
        margin: 0 auto;
      }

      .ant-menu-item::after {
        content: '';
      }

      .ant-menu-item-selected.ant-menu-item::after {
        content: '';
      }
    }

    .ant-menu-inline-collapsed {
      .ant-menu-submenu-open {
        padding-bottom: 0px !important;
      }

      .ant-menu-submenu {
        margin-bottom: 0px !important;
      }

      .ant-menu-item::after {
        content: '';
      }

      .ant-menu-item-selected.ant-menu-item::after {
        content: '';
      }
    }
  }

  .ant-layout-header {
    position: sticky !important;
    top: 0;
    left: 0;
  }

  .ant-layout-footer {
    height: 0;
    padding: 0 !important;
  }

  .ant-layout-sider-collapsed {
    .ant-layout-sider-children {
      width: 86px !important;
    }
  }

  .ant-pro-setting-drawer-handle {
    display: none !important;
  }

  .ant-layout {
    overflow-y: auto !important;
    height: 100vh !important;
  }

  /*全局提示样式*/
  .ant-message {
    margin: 0 auto;
    text-align: center;
    display: flex;
    justify-content: center;
  }

  /*全局表格样式重置*/

  .ant-table-tbody > tr > td {
    border-bottom: 0px solid #ECF2FD !important;
    border-top: 1px solid #ECF2FD !important;
  }
  .ant-table-body {
    border: 1px solid #ECF2FD !important;
    border-radius: 8px;
  }
  .ant-table-footer{
    background-color:#F8F8F9!important;
    border-radius: 0px 0px 8px 8px!important;
  }
  .ant-table-column-title{
    font-family: 'SourceHanSansSCBold';
    font-weight: bold;
    font-size: 14px;
  }
  .ant-table-thead > tr > th:first-child {
    border-top-left-radius: 8px !important;
  }
  .ant-table-thead > tr > th:last-child {
    border-top-right-radius: 8px !important;
  }
  .ant-table-thead > tr > th {
    padding: 12px 16px !important;
    height: 44px !important;
    border-bottom: 0 !important;
  }
  .ant-table-tbody > tr > td {
    padding: 8px 16px !important;
   height: 49px !important;
  }
  .ant-table-header{
    border-radius: 8px;
  }
  .ant-radio-button-wrapper:first-child {
    border-left: 1px solid #d9d9d9;
    border-radius: 4px 0 0 4px !important;
  }

  .ant-radio-button-wrapper:last-child {
    border-radius: 0 4px 4px 0 !important;
  }

  .screen-xs {
    .ant-pro-page-header-wrap {
      display: none!important;
    }
  }
  .screen-sm {
    .ant-pro-page-header-wrap {
      display: none!important;
    }
  }

  .lticon {
    font-family: 'lticon' !important;
    font-size: 16px;
    font-style: normal;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  .icon-order:before {
    content: '\e650';
  }

  .icon-basketball:before {
    content: '\e7d0';
  }

  .icon-search:before {
    content: '\e7d1';
  }

  .icon-coupon1:before {
    content: '\e7d2';
  }

  .icon-luru:before {
    content: '\e7d3';
  }

  .icon-caiwu2:before {
    content: '\e7d4';
  }

  .icon-rank:before {
    content: '\e7d5';
  }

  .icon-kakeimg:before {
    content: '\e7d6';
  }

  .icon-moneybi:before {
    content: '\e7d7';
  }

  .icon-file:before {
    content: '\e7d8';
  }

  .icon-cawu:before {
    content: '\e7d9';
  }

  .icon-goods:before {
    content: '\e7cf';
  }

  .icon-down:before {
    content: '\e7da';
  }

  .icon-right:before {
    content: '\e7db';
  }

  .icon-wenhao:before {
    content: '\e7dc';
  }

  .icon-jth:before {
    content: '\e7dd';
  }
</style>
